<?php

class Admin_IndexController extends Zend_Controller_Action
{
	// Do some checks here (including authorization)
	public function init()
	{
		parent::init();

		$sessAccount = Account_Model_Session::getAccount();
		if ($sessAccount === NULL) {
			$this->_redirect('/');
		}
		$gOpts = Kernel::getInstance()->getOptions();
		if (is_array($gOpts['site']) && is_array($gOpts['site']['administrator'])
			&& isset($gOpts['site']['administrator']['idname'])) {
			if ($sessAccount->getIdName() != $gOpts['site']['administrator']['idname']) {
				$this->_redirect('/');
			}
		}
	}


    public function indexAction()
    {
		//TODO: double login

		$this->_redirect('/admin/general');
    }
}
